# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Adam Fontenot <adam.m.fontenot@gmail.com>

pkgname=breezy
pkgver=3.3.4
pkgrel=1
pkgdesc='A decentralized revision control system with support for Bazaar and Git file formats'
arch=(loong64 x86_64)
url=https://www.breezy-vcs.org/
license=(GPL2)
depends=(
  python-configobj
  python-dulwich
  python-fastbencode
  python-merge3
  python-patiencediff
  python-six
  python-yaml
)
makedepends=(
  cython
  git
  python-fastimport
  python-gpgme
  python-packaging
  python-paramiko
  python-setuptools
  python-setuptools-gettext
  python-setuptools-rust
)
optdepends=(
  'python-fastimport: Fastimport support'
  'python-gpgme: PGP support'
  'python-paramiko: access branches over SFTP'
)
provides=(bzr)
conflicts=(bzr)
replaces=(bzr)
_tag=d206a54af4040025561cc9159fa5559c14a7ef46
source=(git+https://github.com/breezy-team/breezy.git#tag=${_tag}
breezy-fix-install.patch)
sha256sums=('SKIP'
            '1e778eae61605bd8a99d57ce97da4ac9ca74fe1b86c371fd55805e96aeb347e8')

pkgver() {
  cd breezy
  git describe --tags | sed 's/brz-//; s/-/./g'
}

prepare() {
  cd breezy
	patch -p1 -i "$srcdir/breezy-fix-install.patch"
}

build() {
  cd breezy
  python setup.py build
}

package() {
  cd breezy
  python setup.py install --root="${pkgdir}" --install-data=usr/share --optimize=1 --skip-build
  ln -s brz "${pkgdir}"/usr/bin/bzr # backwards compatibility
}

# vim: ts=2 sw=2 et:
